package com.expense.common.model.base;

import com.expense.common.constant.enums.DeletedStatus;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import lombok.Data;
import org.beetl.sql.core.TailBean;
import org.beetl.sql.core.annotatoin.AutoID;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Map;

@Data
public class BaseModel  extends TailBean implements java.io.Serializable {

    @NotNull(message = "ID不能为空")
    @AutoID
    public Long id;

    /**
     * 逻辑删除状态
     */
    public DeletedStatus deleted;

    /**
     * 创建时间
     */
    public Date createAt;

    //创建人
    public Long creatorId;

    //最后修改日期
    public Date modifyAt;

    //最后修改人
    public Long modifierId;

    @JsonAnyGetter
    public Map<String, Object> getTails(){
        return super.getTails();
    }
}
